class Lineup:
  def __init__(self, headend_id, device_type_code, lcn, onid, tsid, sid, frequency, ch_id, ch_name):
    self._headend_id = headend_id
    self._device_type_code = device_type_code
    self._lcn = lcn
    self._onid = onid
    self._tsid = tsid
    self._sid = sid
    self._frequency = frequency
    self._ch_id = ch_id
    self._ch_name = ch_name

  def __str__(self):
    return "{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}".format(self._headend_id, self._device_type_code, 
        self._lcn, self._onid, self._tsid, self._sid, self._frequency, self._ch_id, self._ch_name)

  def eq_without_ch_name(self, other):
    if isinstance(other, Lineup):
      if isinstance(self._frequency, int):
        return (self._headend_id == other._headend_id) and \
            (self._device_type_code == other._device_type_code) and \
            (self._lcn == other._lcn) and \
            (self._onid == other._onid) and \
            (self._tsid == other._tsid) and \
            (self._sid == other._sid) and \
            abs(self._frequency - other._frequency) < 10
      else:
        return (self._headend_id == other._headend_id) and \
            (self._device_type_code == other._device_type_code) and \
            (self._lcn == other._lcn) and \
            (self._onid == other._onid) and \
            (self._tsid == other._tsid) and \
            (self._sid == other._sid) and \
            (self._frequency == other._frequency)
    return NotImplemented
